import request from '@/utils/request.js'


//注册用户
export const SignUp = (data) => {
	return request.post('/login/signUp', {
		phone: data.username,
		// email: data.email,
		password: data.password,
		enterPassword: data.rePassword
	}, {
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
	}
	);
}

//用户登录
export function Login(data) {
	return request.post('/login', {
		phone: data.username,
		password: data.password
	}, {
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
	}
	)
}

//登录后获取用户基本信息
export const userInfo = () => {
	return request.get('/login')
}

//用户修改密码
export const userupdataPs = (data) => {
	return request.post('/login/repd', {
		oldPassword: data.oldPassWord,
		newPassword: data.newPassword,
		enterPassword: data.renewPassword
	}, {
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
	})
}